package com.op.studyingliteapp.activity;

import java.io.File;

import com.op.studyingliteapp.R;
import com.op.studyingliteapp.R.id;
import com.op.studyingliteapp.R.layout;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.Toast;

public class PhotoActivity extends Activity{
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_photo);
		showPhoto();
	
	}
	
	public void showPhoto(){
		try {
			ImageView imageView = (ImageView) findViewById(R.id.photo_view);  
			Bundle bundle = getIntent().getExtras();
			String filePath = bundle.getString("filePath");
			Toast.makeText(getApplication(), ""+filePath,Toast.LENGTH_SHORT).show();
			Bitmap bitmap = BitmapFactory.decodeFile(filePath);
            //将图片显示到ImageView中
			imageView.setImageBitmap(bitmap);
		} catch (Exception e) {
			e.printStackTrace();
		}    
          
	}
}
